{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np \n",
    "from PIL import Image"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def concate(num):\n",
    "    count = 0\n",
    "    while count < num:\n",
    "        im0 = Image.open(\"./True/True\" + str(count) + \".png\")\n",
    "        im1 = Image.open(\"./Pred/Pred\" + str(count) + \".png\")\n",
    "\n",
    "        im = Image.fromarray(np.concatenate([np.array(im0), np.array(im1)], 1))\n",
    "        im.save(\"./Res\" + str(count) + \".png\")\n",
    "        count += 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "concate(50)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "8d55024ba003f6baabebab9f7235170fef06e203042a215a6906f8950240c723"
  },
  "kernelspec": {
   "display_name": "Python 3.9.7 ('d2l')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
